package com.xxxy.dongyexuan.mapper;

import com.xxxy.dongyexuan.po.Project;
import com.xxxy.dongyexuan.po.User;
import org.apache.ibatis.annotations.*;
import org.mybatis.spring.annotation.MapperScan;

import java.util.List;
@MapperScan("com.xxxy.dongyexuan.demobeautyhaird.mapper")
public interface IProjectMapper {
    @Select("select count(*) from project")
    public int getcount();

    @Select("SELECT * FROM project WHERE pid = #{pid}")
    public Project findById(@Param("pid") int pid);

    @Select("SELECT * FROM project")
    public List<Project> findAll();

    @Insert("INSERT project VALUES (#{pid}, #{pname})")
    public int save(Project project);

    @Update("UPDATE project SET pname = #{pname} WHERE pid = #{pid}")
    public int merge(Project project);

    @Delete("DELETE FROM project WHERE pid = #{pid}")
    public int delete(@Param("pid") int pid);
    @Select("select * from project limit #{from},#{pagesize}")
    public List<Project> findByPage(@Param("from") int from, @Param("pagesize") int pagesize);
}
